import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import pinia from '@/stores/index'
import '@/assets/main.scss'
import { createPinia } from 'pinia'

// 导入 Element Plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 导入 ElMessage 和 ElMessageBox
import { ElMessage, ElMessageBox } from 'element-plus'

// 挂载到全局原型（可选，不推荐）
// app.config.globalProperties.$message = ElMessage
// app.config.globalProperties.$confirm = ElMessageBox

// 更推荐：直接在需要的地方 import { ElMessage, ElMessageBox }

const app = createApp(App)
app.use(createPinia())
app.use(router)
app.use(ElementPlus)

// 挂载前提供全局访问（可选）
app.config.globalProperties.$message = ElMessage
app.config.globalProperties.$confirm = ElMessageBox

app.mount('#app')
app.use(pinia)
app.use(router)
